
/*
 * @ZCW
 * 地图页面
 * */

/******************************公共变量**********************************/

//var showPartMapAreaVar_promptMarker = true;

/******************************************************************/

//单双击左键、移动头像在地图上显示提示框点击确定移动我的位置
function moveCenterPrompt(lnglat){
	//if (showPartMapAreaVar_promptMarker) {
		//提示框的内容
		var promptContext = [];
		promptContext.push('<div class="promitMarker" title="在地图上双击 或者 右键选择 到这里看看 我也会出来喔">');
		promptContext.push('<div class="promitMarker-topAndCenter" style="width: 100%; height: 50px; text-align: center; background-color:#FFFFFF; line-height: 50px;">到这里逛逛?</div>');
		promptContext.push('<div class="promitMarker-topAndCenter" style="width: 100%; height: 50px; text-align: center; background-color:#FFFFFF;">');
		promptContext.push('<span class="promitMarker-topAndCenter-isMove" style="display: block; height: 20px; width: 40px; background-color: #BBCCD3; float: left; margin-left: 40px; text-align: center; line-height: 20px; cursor:pointer" id="doMoveMeMarker" onclick="changeMyAddr('+lnglat.lng+', '+lnglat.lat+')">确定</span>');
		promptContext.push('<span class="promitMarker-topAndCenter-isMove" style="display: block; height: 20px; width: 40px; background-color: #BBCCD3; float: left; margin-left: 40px; text-align: center; line-height: 20px; cursor:pointer" id="notMoveMeMarker" onclick="notChangeMyAddr('+lnglat+')">取消</span>');
		promptContext.push('<span style="clear: both;"></span>');
		promptContext.push('</div>');
		promptContext.push('</div>');
		promptContext.push('<div class="promotMarker-buttom-pointer"><div>');
		
		partMapAreaVar_promptMarker = new AMap.Marker({
			id: "promptMoveMarker",
			zIndex: 4,
			cursor: 'auto',
			position: lnglat,
			content: promptContext.join(""),
			offset: {x: -37, y: -92}
		});
		partMapAreaVar_mapObj.addOverlays(partMapAreaVar_promptMarker);
	//}

}

//确定要移动我的位置的方法
function changeMyAddr(lng, lat) {
	var lnglat = new AMap.LngLat(lng, lat);
	//修改共有变量我的上一个位置的值
	partMapAreaVar_userPosition = lnglat;
	//清除该提示marker
	removeMarker(partMapAreaVar_promptMarker);
	//搜索框样式的改变
	if ($("#search-input").css("display") == "block") {
		$("#search-input").css("display", "none");
		$("#map_pos_info").find("span").css("display", "block");
	}
	
	userWalkOnMap(partMapAreaVar_meMarker, lnglat, partMapAreaVar_mapObj);
}

//不移动我的头像位置
function notChangeMyAddr(lng, lat) {
//	var lnglat = new AMap.LngLat(lng, lat);
	partMapAreaVar_meMarker.setPosition(partMapAreaVar_userPosition);
	//清除该提示marker
	removeMarker(partMapAreaVar_promptMarker);
}

/*
 * @author:zcw
 * 在地图上点击右键的菜单方法
**/
function loadRightClickMenu(needShowInMapObj, lnglat){
	rightClickMenu = new AMap.ContextMenu();
	rightClickMenu.addItem("到这里看看", function(e){
		userWalkOnMap(partMapAreaVar_meMarker, lnglat, partMapAreaVar_mapObj);
		//修改共有变量我的上一个位置的值
		partMapAreaVar_userPosition = lnglat;
	}, 0);
	rightClickMenu.addItem("回到我的位置", function(e){
		partMapAreaVar_mapObj.setCenter(partMapAreaVar_meMarker.position);
	}, 1);
	//根据指定位置(lnglat)在地图上显示菜单
	rightClickMenu.open(needShowInMapObj, lnglat);
}

//移除地图上指定marker的方法
function removeMarker(marker){
	if (marker) {
		partMapAreaVar_mapObj.removeOverlays(marker);
	}
}
	
function userWalkOnMap(meMarker, lnglatXY, mapObj) {
	getPositionInfo(lnglatXY);
	meMarker.setPosition(lnglatXY);
	mapObj.setCenter(lnglatXY); // 设置地图中心点坐标
	partMapAreaMethod_selectArticleImplementation(); // 获取话题列表
}


function groupArticleByPosition(data) {

	var groupList = new Array();
	var nearByPixel = 40;
	
	for (var i = 0; i < data.length; i++) {
		var obj = data[i];
		var pixel=partMapAreaVar_mapObj.lnglatTocontainer(new AMap.LngLat(obj.articlePositionX, obj.articlePositionY));
		var k = 0;
		for ( ; k < groupList.length; k++) {
			var compareObj = groupList[k][0];
			var comparePixel=partMapAreaVar_mapObj.lnglatTocontainer(new AMap.LngLat(compareObj.articlePositionX, compareObj.articlePositionY));
			
			if (Math.abs(pixel.x - comparePixel.x) <= nearByPixel && Math.abs(pixel.y - comparePixel.y) <= nearByPixel) {
				obj.articlePositionX = compareObj.articlePositionX;
				obj.articlePositionY = compareObj.articlePositionY;
				groupList[k][groupList[k].length] = obj;
				break;
			}
		}
		
		if (k == groupList.length) {
			groupList[groupList.length] = new Array(obj);
		}
		
	}
	
	
	return groupList;
}



function drawMarkers(groupList) {
	
	$.each(groupList, function(i, groupElem){
		if (groupElem.length > 1) {
			$.each(groupElem, function(k, obj){
				var previousArticleId = (k == groupElem.length -1) ? groupElem[0].articleId : groupElem[k+1].articleId;
				var nextArticleId = (k == 0) ? groupElem[groupElem.length - 1].articleId : groupElem[k - 1].articleId;
				var articleTitle = obj.articleTitle;
				if (articleTitle.length > 12) {
					articleTitle = articleTitle.substring(0, 12) +"...";
				}
				
				var articleTextSummary = obj.articleTextSummary;
				
				var sexImg = '../resource/images/user/man.png';
				if (obj.articleAuthorSex == 'MALE'){
					sexImg = '../resource/images/user/man.png';
				} else if (obj.articleAuthorSex == 'FEMALE') {
					sexImg = '../resource/images/user/woman.png';
				}
				
				var articleMessageHtmlStr = 
				"<div style='height:177px; width:355px; background: transparent; margin-top: -10px'>"
				+	"<div style='background: #FFFFFF; border-radius:3px; float: left; height: 156px; width: 340px; margin-left: 12px; border: 1px solid #CCC; box-shadow: -moz-box-shadow:1px 2px 3px #382C2C; -webkit-box-shadow:1px 2px 3px #382C2C; box-shadow:1px 2px 3px #382C2C;'>"
				+	"</div>"
				+	"<div style='background: #FFFFFF; border-radius:3px; float: left; height: 156px; width: 340px; margin-top: 5px; margin-left: -348px; border: 1px solid #CCC; box-shadow: -moz-box-shadow:1px 2px 3px #382C2C; -webkit-box-shadow:1px 2px 3px #382C2C; box-shadow:1px 2px 3px #382C2C;'>"
				+	"</div>"
				+	"<div style='background: #FFFFFF; border-radius:3px; float: left; height: 156px; width: 340px; margin-top: 10px; margin-left: -354px; border: 1px solid #CCC; box-shadow: -moz-box-shadow:1px 2px 3px #382C2C; -webkit-box-shadow:1px 2px 3px #382C2C; box-shadow:1px 2px 3px #382C2C;'>"
					
					+	"<div class='index-articleList-oneArticle-top' style='margin-top: 5px;'>"
					+		"<div class='index-articleList-oneArticle-authorLogo' style='margin-left: 10px;'>"
					+			"<img alt='' src='" +obj.articleAuthorLogoUrl+ "' style='width: 38px; height: 38px;'/>"		
					+		"</div>"
					+		"<div class='index-articleList-oneArticle-authorMessage'>"
					/* +			"<div class='index-articleList-oneArticle-authorMessage-name' style='width: 260px; margin-left: 10px;'><a href='javascript:void(0)' target='_blank'>" +obj.articleAuthorName+ "</a><span style='margin-left: 15px;'><img src='"+sexImg+"'></span>" */
					/*+			"<div class='index-articleList-oneArticle-authorMessage-name' style='width: 260px; margin-left: 10px;'><span style='display:block; float:left;'><a href='javascript:void(0)' target='_blank'>" +obj.articleAuthorName+ "</a><img style='margin-left: 15px;' src='"+sexImg+"'></span>"*/
					+			"<div class='index-articleList-oneArticle-authorMessage-name' style='width: 260px; margin-left: 10px;'><span style='display:block; float:left;'><b style='color:#0078B6;'>"+obj.articleAuthorName+"</b><img style='margin-left: 15px;' src='"+sexImg+"'></span>"
					+				"<span style='float: right; display:block; color: #666666; font-width: bold;'>"+(groupElem.length-k)+"&nbsp;/&nbsp;"+groupElem.length+"</span>"
					+				"<span style='float: right; display:block;'><a style='font-size: 12px; font-width: none; display:block;' href='javascript:changeArticle(\""+obj.articleId+"\",\""+nextArticleId+"\")'>下一篇</a>&nbsp;&nbsp;</span>"
					+				"<span style='float: right; display:block;'><a style='font-size: 12px; font-width: none; display:block;' href='javascript:changeArticle(\""+obj.articleId+"\",\""+previousArticleId+"\")'>上一篇</a>&nbsp;</span>"
					+				"<span style='clear: both;'></span>"
					+			"</div>"
					+			"<div class='index-articleList-oneArticle-authorMessage-others' style='margin-left: 10px;'>"
					+				"<span style='display:block; float:left;'>"+obj.articleAuthorStatement+"</span>"
					+				"<span style='display:block; float:right; margin-right:-15px;'>"+obj.articleSubmitDate+"</span>"
					+				"<span style='clear:both;'></span>"
					+			"</div>"
					+		"</div>"
					+		"<div style='clear:both;'></div>"
					+	"</div>"
					+	"<div style='height: 5px; width: 5px; clear: both;'></div>"
					;
				if (obj.articleSummaryPictureUrl){
					if (articleTextSummary.length > 50){
						articleTextSummary = articleTextSummary.substr(0, 50) + "...";
					}
					articleMessageHtmlStr +=
						"<div style='width: 206px; height: 100px;float: left;line-height: 20px; margin-left: 25px;'>"
					+		"<div style='width:205px; height: 18px; line-height: 18px; font-size: 14px; text-align: center;'>"
					+			"<a href='../article/showArticleDetails?id="+obj.articleId+"' target='_blank'>"+articleTitle+"</a>"
					+		"</div>"
					+		"<div style='width: 206px; height: 80px; line-height: 20px; word-break:break-all'>"
					+ 			articleTextSummary +"<br/><a href='../article/showArticleDetails?id="+obj.articleId+"' target='_blank'>查看全文>></a>"
					+		"</div>"
					+	"</div>"
					+	"<div style='width: 90px;height: 90px;float: left; margin-left: 10px; margin-top: 5px;'>"
					+		"<img src='"+ obj.articleSummaryPictureUrl +"' style='max-height:90px; max-width:90px' />"
					+	"</div>"
					+	"<div style='height: 6px; width: 5px; clear: both;'></div>"
					+	"<div class='articleMessage-box-pointer'></div>"
					+"</div>"
					;
				} else {
					if (articleTextSummary.length > 60){
						articleTextSummary = articleTextSummary.substr(0, 60) + "...";
					}
					articleMessageHtmlStr +=
						"<div style='width: 300px; height: 100px;float: left;line-height: 20px; margin-left: 25px;'>"
					+ 		"<div style='width:300px; height: 18px; line-height: 18px; font-size: 14px; text-align: center;'>"
					+			"<a href='../article/showArticleDetails?id="+obj.articleId+"' target='_blank'>"+articleTitle+"</a>"
					+		"</div>"
					+		"<div style='width: 300px; height: 80px; line-height: 20px; word-break:break-all'>"
					+ 			articleTextSummary +"<br/><a href='../article/showArticleDetails?id="+obj.articleId+"' target='_blank'>查看全文>></a>"
					+		"</div>"
					+	"</div>"
					+	"<div style='height: 6px; width: 5px; clear: both;'></div>"
					+	"<div class='articleMessage-box-pointer'></div>";
				}
				articleMessageHtmlStr +=
					"</div>"
				+	"<div style='clear: both;'></div>"
				+"</div>"
				;
				
				
				var articleMessageMarker = new AMap.Marker({
					id: new String("articleMessage" +obj.articleId),
					zIndex: 3,
					cursor: 'auto',
					type:"articleMessageMarker",
					position: new AMap.LngLat(obj.articlePositionX, obj.articlePositionY),
					offset:{
						x: -22,
						y: -193
					},
					content: articleMessageHtmlStr
				});
				
				partMapAreaVar_mapObj.addOverlays(articleMessageMarker);
				
				/*
				* @author zcw
				* 绑定鼠标移动到标记对应文章概要时的鼠标事件
				**/
				partMapAreaVar_mapObj.bind(articleMessageMarker, "mouseover", function(){
					stopHidden("#" +articleMessageMarker.id);
					articleMessageMarker.setVisible(true);
//					showPartMapAreaVar_promptMarker = false;
				});
				partMapAreaVar_mapObj.bind(articleMessageMarker, "mouseout", function(){
					articleMessageMarker.setVisible(false);
//					partMapAreaVar_promptMarker = true;
				});
				
				articleMessageMarker.setVisible(false);
				
				var markerContentHtmlStr = '<div style="width:47px; height:42px;">'
									   +	'<div style="width:37px; height:37px; border: 1px solid #c0c0c0; float:right; background:#FFFFFF; border-radius:2px;"></div>'
									   +	'<div style="width:37px; height:37px; border: 1px solid #c0c0c0; float:right; margin-top:3px; margin-right:-36px; background:#FFFFFF; border-radius:2px;"></div>'
									   +	'<div class="articleAuthorLogoMarkerContent" style="width:37px; height:37px; position:relative; float:right; margin-right:-36px; margin-top:6px;border-radius:2px;">'
									   +		'<div class="jian_menu-triangle-border jian_menu-tb-background"></div>'  
									   +		'<div class="jian_menu-triangle-border jian_menu-tb-border"></div>'
									   +		'<img src="'+ obj.articleAuthorLogoUrl +'" style="width:33px;height:33px;margin-left:2px; margin-top:2px;"/>'
									   /*+		'<img src="../resource/images/user/default_head_img.gif" style="width:38px;height:38px;margin-left:1px; margin-top:1px;"/>'*/
									   +	'</div>' 
									   +	'<div style="clear:both;"></div>'
									   +'</div>';
				
				var marker = new AMap.Marker({  
					id: obj.articleId,
					//zIndex: groupElem - k,
					zIndex: 1,
					position: new AMap.LngLat(obj.articlePositionX, obj.articlePositionY),  
				    /*content: "<div class='map_tb_articleMarker_coincide'><img src='"+ obj.articleAuthorLogoUrl + "' class='map_tb_img_articleMarker_coincide'/></div>",*/
					content: markerContentHtmlStr,
					offset:{x:-8,y:-34}  
				});

				partMapAreaVar_mapObj.addOverlays(marker);
				
				partMapAreaVar_mapObj.bind(marker, "mouseover", function(){
					MouseTimer = setTimeout(function(){
//						showPartMapAreaVar_promptMarker = false;
						$("#" +articleMessageMarker.id).fadeIn(10, function(){
							articleMessageMarker.setVisible(true);
						});
					}, 100);
				});
				
				partMapAreaVar_mapObj.bind(marker, "mouseout", function(){
					if (MouseTimer){
						clearTimeout(MouseTimer);
//						showPartMapAreaVar_promptMarker = true;
						$("#" +articleMessageMarker.id).fadeOut(300, function(){
							articleMessageMarker.setVisible(false);
						});
					}
				});
			});	
		} else {
			
			var obj = groupElem[0];
			
			var articleTitle = obj.articleTitle;
			if (articleTitle.length > 12) {
				articleTitle = articleTitle.substring(0, 12) +"...";
			}
			
			var articleTextSummary = obj.articleTextSummary;
			
			var sexImg = '../resource/images/user/man.png';
			if (obj.articleAuthorSex == 'MALE'){
				sexImg = '../resource/images/user/man.png';
			} else if (obj.articleAuthorSex == 'FEMALE') {
				sexImg = '../resource/images/user/woman.png';
			}
			
			var markerContentHtmlStr = '<div class="articleAuthorLogoMarkerContent">'  
											+'<div class="jian_menu-triangle-border jian_menu-tb-background"></div>'  
											+	'<div class="jian_menu-triangle-border jian_menu-tb-border"></div>' 
										+	'<img src="'+ obj.articleAuthorLogoUrl +'" style="width:33px;height:33px;margin-left:2px; margin-top:2px;"/>'
											/*+'<img src="../resource/images/user/default_head_img.gif" style="width:38px;height:38px;margin-left:1px; margin-top:1px;"/>'*/
										+'</div>';
			
			var marker = new AMap.Marker({  
				id: obj.articleId,
				zIndex: 1,
				position: new AMap.LngLat(obj.articlePositionX, obj.articlePositionY),  
			    /*content: $("<div class='map_tb_articleMarker'><img src='"+ obj.articleAuthorLogoUrl + "' class='map_tb_img_articleMarker'/></div>").get(0),*/
				content: markerContentHtmlStr,
				offset:{x:-16,y:-37}  
			});
			partMapAreaVar_mapObj.addOverlays(marker);
			
			var articleMessageHtmlStr =
				"<div class='articleMessage-box'>"
				+	"<div class='index-articleList-oneArticle-top' style='margin-top: 5px;'>"
				+		"<div class='index-articleList-oneArticle-authorLogo' style='margin-left: 10px;'>"
				+			"<img alt='' src='" +obj.articleAuthorLogoUrl+ "' style='width: 38px; height: 38px;'/>"		
				+		"</div>"
						
				+		"<div class='index-articleList-oneArticle-authorMessage'>"
				/*+			"<div class='index-articleList-oneArticle-authorMessage-name' style='width: 260px; margin-left: 10px;'><a href='javascript:void(0)' target='_blank'>" +obj.articleAuthorName+ "</a><span style='margin-left: 15px;'><img src='"+sexImg+"'></span></div>"*/
				+			"<div class='index-articleList-oneArticle-authorMessage-name' style='width: 260px; margin-left: 10px;'><b style='color:#0078B6;'>" +obj.articleAuthorName+ "</b><span style='margin-left: 15px;'><img src='"+sexImg+"'></span></div>"
				+			"<div class='index-articleList-oneArticle-authorMessage-others' style='margin-left: 10px;'>"
				/*+				"<span>"+obj.articleAuthorStatement+"</span>"
				+				"<span style='margin-left: 30px;'>"+obj.articleSubmitDate+"</span>"*/
				+				"<span style='display:block; float:left;'>"+obj.articleAuthorStatement+"</span>"
				+				"<span style='display:block; float:right; margin-right:-15px;'>"+obj.articleSubmitDate+"</span>"
				+				"<span style='clear:both;'></span>"
				+			"</div>"
				+		"</div>"
				+		"<div style='clear:both;'></div>"
				+	"</div>"
				+	"<div style='height: 5px; width: 5px; clear: both;'></div>"
				;
			if (obj.articleSummaryPictureUrl){
				if (articleTextSummary.length > 50){
					articleTextSummary = articleTextSummary.substr(0, 50) + "...";
				}
				articleMessageHtmlStr +=
					"<div style='width: 206px; height: 100px;float: left;line-height: 20px; margin-left: 25px;'>"
				+		"<div style='width:205px; height: 18px; line-height: 18px; font-size: 14px; text-align: center;'>"
				+			"<a href='../article/showArticleDetails?id="+obj.articleId+"' target='_blank'>"+articleTitle+"</a>"
				+		"</div>"
				+		"<div style='width: 206px; height: 80px; line-height: 20px; word-break:break-all'>"
				+ 			articleTextSummary +"<br/><a href='../article/showArticleDetails?id="+obj.articleId+"' target='_blank'>查看全文>></a>"
				+		"</div>"
				+	"</div>"
				+	"<div style='width: 90px;height: 90px;float: left; margin-left: 10px; margin-top: 5px;'>"
				+		"<img src='"+ obj.articleSummaryPictureUrl +"' style='max-height:90px; max-width:90px' />"
				+	"</div>"
				+	"<div style='height: 6px; width: 5px; clear: both;'></div>"
				+	"<div class='articleMessage-box-pointer'></div>"
				+"</div>"
				;
			} else {
				if (articleTextSummary.length > 60){
					articleTextSummary = articleTextSummary.substr(0, 60) + "...";
				}
				articleMessageHtmlStr +=
					"<div style='width: 300px; height: 100px;float: left;line-height: 20px; margin-left: 25px;'>"
				+ 		"<div style='width:300px; height: 18px; line-height: 18px; font-size: 14px; text-align: center;'>"
				+			"<a href='../article/showArticleDetails?id="+obj.articleId+"' target='_blank'>"+articleTitle+"</a>"
				+		"</div>"
				+		"<div style='width: 300px; height: 80px; line-height: 20px; word-break:break-all'>"
				/*+ 			articleTextSummary +"<a href='../article/showArticleDetails?id="+obj.articleId+"' target='_blank'>查看全文>></a>"*/
				+ 			+"<p>" +articleTextSummary + "</p>"
				+			"<a href='../article/showArticleDetails?id="+obj.articleId+"' target='_blank'>查看全文>></a>"
				+		"</div>"
				/*+		"<div style='width:300px; height:15px; line-height:15px;'>" 
				+			"<a href='../article/showArticleDetails?id="+obj.articleId+"' target='_blank'>查看全文>></a>"
				+		"<div>"*/
				+	"</div>"
				
				+	"<div style='height: 6px; width: 5px; clear: both;'></div>"
				
				+	"<div class='articleMessage-box-pointer'></div>"
				+"</div>"
				;
			}
			
			var articleMessageMarker = new AMap.Marker({
				id: new String("articleMessage" +obj.articleId),
				zIndex: 3,
				cursor: 'auto',
				position: new AMap.LngLat(obj.articlePositionX, obj.articlePositionY),
				offset:{
					x: -32,
					y: -195
				},
				content: articleMessageHtmlStr
			});
			
			partMapAreaVar_mapObj.addOverlays(articleMessageMarker);
			
			/*
			* @author zcw
			* 绑定鼠标移动到标记对应文章概要时的鼠标事件
			**/
			partMapAreaVar_mapObj.bind(articleMessageMarker, "mouseover", function(){
				stopHidden("#" +articleMessageMarker.id);
				articleMessageMarker.setVisible(true);
//				showPartMapAreaVar_promptMarker = false;
			});
			partMapAreaVar_mapObj.bind(articleMessageMarker, "mouseout", function(){
				articleMessageMarker.setVisible(false);
//				showPartMapAreaVar_promptMarker = true;
			});
			
			articleMessageMarker.setVisible(false);
			
			partMapAreaVar_mapObj.bind(marker, "mouseover", function(){
				MouseTimer = setTimeout(function(){
//					showPartMapAreaVar_promptMarker = false;
					$("#" +articleMessageMarker.id).fadeIn(10, function(){
						articleMessageMarker.setVisible(true);
					});
				}, 100);
			});
			
			partMapAreaVar_mapObj.bind(marker, "mouseout", function(){
				if (MouseTimer){
					clearTimeout(MouseTimer);
//					showPartMapAreaVar_promptMarker = true;
					$("#" +articleMessageMarker.id).fadeOut(350, function(){
						articleMessageMarker.setVisible(false);
					});
				}
			});
		}
	});
	
}

//停止元动画效果,并恢复白亮
function stopHidden(id) {
	$(id).stop();
	$(id).css("opacity", 10);
}


//marker上点击上一篇、下一篇时的事件处理
function changeArticle(nowShowMarkerId, needShowMarkerId) {
	
	partMapAreaVar_mapObj.getOverlays("articleMessage" +nowShowMarkerId).setVisible(false);
	
	if ($("#articleMessage" +needShowMarkerId).css('display') == 'none') {
		$("#articleMessage" +needShowMarkerId).css('display', 'block');
	}
	
	partMapAreaVar_mapObj.getOverlays("articleMessage" +needShowMarkerId).setVisible(true);
	
	removeMarker(partMapAreaVar_promptMarker);
}

function updateWhenArticleSelected(dataSet) {
	partMapAreaVar_mapObj.clearOverlays();
	partMapAreaVar_mapObj.addOverlays(partMapAreaVar_meMarker);
	partMapAreaVar_mapObj.setCenter(partMapAreaVar_meMarker.position);
	drawMarkers(groupArticleByPosition(dataSet.list));
}
function showArticleMessageInMap(articleId){
	MouseTimer = setTimeout(function(){
		//设置地图中心在这里
		var needShowMarker = partMapAreaVar_mapObj.getOverlays(articleId);
		partMapAreaVar_mapObj.setCenter(needShowMarker.position);
		$("#" + articleId).fadeIn(10, function(){
			needShowMarker.setVisible(true);
		});
	}, 250);
}

function hiddenArticleMessageFromMap(articleId){
	if (MouseTimer){
		clearTimeout(MouseTimer);
		$("#" + articleId).fadeOut(1000, function(){
			partMapAreaVar_mapObj.getOverlays(articleId).setVisible(false);
		});
	}
}

